package com.hnas.eCard.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.hnas.eCard.dao.CommoditOrderDetailDao;
import com.hnas.eCard.orm.CommoditOrderDetail;
import com.hnas.eCard.service.CommoditOrderDetailService;
import com.hnas.eCard.service.dto.DTOCommoditOrder;

@Component("commoditOrderDetailService")
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public class CommoditOrderDetailServiceImpl implements CommoditOrderDetailService{

	@Autowired
	private CommoditOrderDetailDao commoditOrderDetailDao;
	
	@Override
	public CommoditOrderDetail findByOrderNo(String orderNo) {
		return commoditOrderDetailDao.findByOrderNo(orderNo);
	}

	@Override
	public CommoditOrderDetail saveOrUpdate(CommoditOrderDetail commoditOrderDetail) {
		return commoditOrderDetailDao.saveOrUpdate(commoditOrderDetail);
	}

	@Override
	public boolean confirmConsume(String accId, String orderNo, String mrchId, String termNo, String termSno,String dealDate) {
		return commoditOrderDetailDao.confirmConsume(accId,orderNo,mrchId,termNo,termSno,dealDate);
	}

	@Override
	public List<DTOCommoditOrder> findOrderListByAccId(String accId, int pageNo, int pageSize, String stateStr) {
		return commoditOrderDetailDao.findOrderListByAccId(accId,pageNo,pageSize,stateStr);
	}

}
